package simulation.CreatorPackage;

import java.util.Scanner;

import simulation.ConstantCenterOfMass;
import simulation.Factory;
import simulation.InverseProportionalCenterOfMass;
import simulation.Model;

public class centerMassCreator extends Creator {
	private final Factory myFactory;

	public centerMassCreator(Factory factory) {
		myFactory=factory;
	}

	@Override
	public void createObjectInModel(Scanner line, Model model) {
		double magnitude=line.nextDouble();
    	double expo=line.nextDouble();
    	if (expo==2.0){
    		model.add(new InverseProportionalCenterOfMass(magnitude));
    	}
    	else  
    	{
    		model.add(new ConstantCenterOfMass(magnitude));
    	}
		// TODO Auto-generated method stub

	}

}
